<?php defined('InTuntronKJ') or exit('Access Invalid!');?>



<!--crumbs start-->
<div class="crumbs">
    <input  type="hidden" id ="pidUserName"/>
    <ul>
        <li><span class="strong">当前位置：</span></li>
        <li><a href="#LotteryHall">首页</a></li>
        <li><a href="#MemberManage">会员管理</a></li>
        <li><div id="li_hierarchy"></div></li>
    </ul>
    <div class="clear"></div>
</div>
<!--crumbs end-->

<!--list_main start-->
<div class="list_main">
    <!--list_header start-->
    <div class="list_header">

        <!--list_nav start-->
        <div class="list_nav">
            <ul>
                <li class="current"><a href="#MemberManage">会员管理</a></li>
                <li><a href="#MemberManage&op=TeamGamerecord">游戏记录</a></li>
        		<li><a href="#MemberManage&op=TeamRprofitloss">盈亏报表</a></li>
        		<li><a href="#MemberManage&op=TeamCoinAll">团队统计</a></li>
        		<li><a href="#MemberManage&op=TeamCoin">账变记录</a></li>
        		<li><a href="#MemberManage&op=TeamRecharge">充值记录</a></li>
        		<li><a href="#MemberManage&op=TeamCashRecord">提现记录</a></li>
        		<li><a href="#MemberManage&op=Links">推广链接</a></li>
            </ul>
            <div class="clear"></div>
        </div>
        <!--list_nav end-->

        <!--list_sort start-->
        <div class="list_sort">
        	<div class="tnsi_sub tnsis_label" style="float:left">
                	<div class="base_select">
	                    <select id="lotterySelectId">
	                        <option value="0" selected="selected">所有人</option>
	                        <option value="1" >我自己</option>
	                        <option value="2">直属下线</option>
	                        <option value="3">所有下线</option>
	                    </select>      
                    </div>          
            </div>
            
            <div class="list_sort_item">
                 <div class="dc_sub dc_split"><span>用户名/昵称</span></div>
            </div>
            <div class="list_sort_item">
	            <div class="base_text bt_d">
	                 <input type="text" id="search_user"/>
	                 <input type="hidden" id="searchname" value=<?php echo $output['username'] ?>>
	            </div>            
            </div>
            
            <div class="list_sort_item">
                <div class="base_button">
                    <button id="btnSearch">筛选</button>
                </div>
            </div>
            <!--            
            <div class="list_sort_item">
                <div class="simle_search">
                        <div class="base_text">
                            <input type="text" id="search_user" />
                        </div>
                        <div class="base_button">
                            <button id="btnSearch">查找用户</button>
                        </div>

                </div>
            </div>
             -->
            
            <div class="list_sort_item">
                <div class="base_button green_button">
                        <button class="add_lower_option">添加下级</button>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <!--list_sort end-->

    </div>
    <!--list_header end-->

    <!--list_table satrt-->
    <div class="list_table">
        <table>
            <thead>
                <tr>
                    <th style="width: 40px;">序号</th>
                    <th style="width: 80px;">用户名</th>
                    <th style="width: 40px;">类型</th>
                    <th>返点</th>
                    <th>可用分数</th>
                    <th>最后登录</th>
                    <th style="width: 40px;">状态</th>
                    <th style="width: 40px;">在线</th>
                    <th>操作</th>
                </tr>
            </thead>
                <tbody>
                	<?php if(!empty($output['user_list']) && is_array($output['user_list'])){?>    
                	<?php foreach($output['user_list'] as $key=>$value){?>            	
                	<tr data-id="<?php echo $key+1?>">
                    	<td class="center"><span class="gry"><?php echo $key+1?></span></td>
                        <td class="center"><span class="base_orgen"><?php echo $value['username']?></span></td>
                        <td class="center"><span class="base_blue"><?php echo $value['type']==0?'会员':'代理' ?></span></td>
                        <td class="center"><span class="base_blue"><?php echo number_format($value['fanDian'],1)?>%</span></td>
                        <td class="center"><span class="base_blue"><?php echo number_format($value['coin'],2)?></span></td>
                        <td class="center"><span class="base_gry"><?php echo $value['updateTime']?></span></td>
                        <td class="center"><span class="base_green">正常</span></td>
                        <td class="center"><span class="line_statc">
                        <?php if($value['isOnLine']){?>
                        	<em class="online" title="在线">在线</em>
                        <?php }else{?>                        	
                        	<em class="offline" title="离线">离线</em>
                        <?php }?>
                        </span></td>
						<td class="center td_options">
							<?php if($value['uid'] == $output['$userinfo']['uid'] || (!empty($output['parent_uid']) && in_array($value['uid'],$output['parent_uid']))){?>
                        	<a class="editUser" id="<?php echo $value['username'] ?>" ut="<?php echo $value['type']==0?'会员':'代理' ?>" rt="<?php echo number_format($value['fanDian'],1)?>" rf="<?php echo $output['userinfo']['fanDian']?>" bt="<?php echo number_format($value['fanDianBdw'],1) ?>" href="javascript:void(0);">修改返点</a>
                        	<?php }?>     
                        	<?php if($value['type']==1){?>                   	
                        	<a class="searchUser" id="<?php echo $value['username'] ?>">查看下级</a>
                        	<?php }?>
                        </td>
                    </tr>
                    <?php }?>
                    
                	<?php }else{?>
                    <tr>
                        <td colspan="9">
                            <!--no_result start-->
                            <div class="no_result user_null">
                                <div class="nr_icon">&nbsp;</div>
                                <div class="nr_info">
                                    <h4>没有会员记录可以显示！</h4>
                                    <p>没有找到您的会员记录！</p>
                                </div>
                            </div>
                            <!--no_result end-->
                        </td>
                    </tr>
                    <?php }?>
                </tbody>
                <!--  
                <?php if(!empty($output['user_list']) && is_array($output['user_list'])){?>  
                <tfoot>
                    <tr>
                        <td class="center" colspan="4"><span>本页合计</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center" colspan="4"><span>本页共 <?php echo $output['num'] ?> 条记录</span></td>
                    </tr>
                    <tr>
                        <td class="center" colspan="4"><span>总计</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center"><span class="base_blue">0.00</span></td>
                        <td class="center" colspan="4"><span>全部共 <?php echo $output['num'] ?> 条记录</span></td>
                    </tr>
                    <tr>
                        <td class="center" colspan="4"><span>有效会员</span></td>
                        <td class="center"><span class="base_blue">0</span></td>
                        <td class="center"><span class="base_blue"></span></td>
                        <td class="center"><span class="base_blue"></span></td>
                        <td class="center" colspan="4"><span></span></td>
                    </tr>
                </tfoot>
                <?php }?>
                -->
        </table>
    </div>
    <!--list_table end-->

    <!--page_nav start-->
    <div class="page_nav">
        <ul>
            <li><a page_index ="1"  page_change="0" <?php if($output['search']){?>class ="GetDataByPageIndexLower"<?php }else{?>class ="GetDataByPageIndex"<?php }?>href="javascript:">首页</a></li>
            <li><a page_index ="<?php echo $output['page']?>" page_change="-1" <?php if($output['search']){?>class ="GetDataByPageIndexLower"<?php }else{?>class ="GetDataByPageIndex"<?php }?> href="javascript:">上一页</a></li>
            <li><a page_index ="<?php echo $output['page']?>" page_change="1" <?php if($output['page'] != $output['totalpage']){ if($output['search']){?>class ="GetDataByPageIndexLower"<?php }else{?> class ="GetDataByPageIndex"<?php } }?> href="javascript:">下一页</a></li>
            <li><a page_index ="<?php echo $output['totalpage']?>" page_change="0" <?php if($output['search']){?>class ="GetDataByPageIndexLower"<?php }else{?>class ="GetDataByPageIndex"<?php }?> href="javascript:">最后页</a></li>
              <li><span>第
                  <?php echo $output['page']?>
                      /
                  <?php echo $output['totalpage']?>      
                  页</span></li>
              <li><span>共
                      <?php echo $output['count']?>
                      条记录</span></li>
              <li><a page_index ="<?php echo $output['page']?>" page_change="0" <?php if($output['search']){?>class ="GetDataByPageIndexLower"<?php }else{?>class ="GetDataByPageIndex"<?php }?> href="javascript:">刷新</a></li>
        </ul>
        <div class="clear">
            <input type="hidden" value="1" id="currentPage"/></div>
    </div>
    <!--page_nav end-->

</div>
<!--list_main end-->
<!--add_lower start-->
<div class="dialog" id="add_lower">
    <div class="dialog_main">
        <div class="dialog_header">
            <h4>添加下级</h4>
            <div class="dialog_close"><span>关闭</span></div>
        </div>
        <div class="dialog_body">
            <div class="add_lower_form">
                <table>
                    <tbody>
                        <tr>
                            <td style="width: 70px;">类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型:</td>
                            <td>
                                <input name="addUserType" type="radio" />
                                <label>代理</label>
                                <input name="addUserType" type="radio" checked />
                                <label>会员</label></td>
                            <td style="width: 180px;">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>帐&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</td>
                            <td>
                                <div class="base_text" id="addUserTip">
                                    <input id="addUserName" type="text" />
                                </div>
                            </td>
                            <td>
                                <div class="form_tips"><span>长度20位以下。</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td>返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点:</td>
                            <td>
                                <div class="stepping_input" id="rebate_steping">
                                    <div class="st_input">
                                        <input type="text" class="sti_base" value="" />
                                        <input type="hidden" id="addUserReturnPoint" class="sti_value" value="<?php echo $output['userinfo']['fanDian']?>" />
                                    </div>
                                    <div class="st_option">
                                        <div class="sto_btn sp_add"><span>增加</span></div>
                                        <div class="sto_btn sp_reduce"><span>减小</span></div>
                                    </div>
                                </div>
                            </td>
                            <td>
                                <div class="form_tips"><span id="rebate_steping_tips">0.0%&nbsp;&nbsp;-&nbsp;&nbsp;<?php echo $output['userinfo']['fanDian']?>%</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td>不定位返点:</td>
                            <td>
                                <div class="stepping_input" id="rebate_not_steping">
                                    <div class="st_input">
                                        <input type="text" class="sti_not_base" value="" />
                                        <input type="hidden" id="addUserNotReturnPoint" class="sti_not_value" value="<?php echo $output['userinfo']['fanDianBdw']?>" />
                                    </div>
                                    <div class="st_option">
                                        <div class="sto_btn sp_add"><span>增加</span></div>
                                        <div class="sto_btn sp_reduce"><span>减小</span></div>
                                    </div>
                                </div>
                            </td>
                            <td>
                                <div class="form_tips"><span id="rebate_not_steping_tips">0.0%&nbsp;&nbsp;-&nbsp;&nbsp;<?php echo $output['userinfo']['fanDianBdw']?>%</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
                            <td>
                                <div class="base_text">
                                    <input id="addUserPass" type="password" />
                                </div>
                            </td>
                            <td>
                                <div class="form_tips"><span>6~16位英文、数字、符号。</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td>确&nbsp;认&nbsp;密&nbsp;码:</td>
                            <td>
                                <div class="base_text">
                                    <input id="addUserConPass" type="password" />
                                </div>
                            </td>
                            <td>
                                <div class="form_tips"><span></span></div>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <div class="base_button_group">
                                    <div class="base_button">
                                        <input type="button" id="lower_cofirm" value="确认添加" />
                                    </div>
                                    <div class="base_button">
                                        <input type="button" id="lower_chanle" value="取消" />
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--add_lower end-->

<!--editor_lower start-->
<div class="dialog" id="editor_lower">
  <div class="dialog_main">
    <div class="dialog_header">
      <h4>修改用户返点</h4>
      <div class="dialog_close"><span>关闭</span></div>
    </div>
    <div class="dialog_body">
      <div class="add_lower_form">
        <table>
          <tbody>
            <tr>
              <td style="width:70px;">类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型:</td>
              <td><div class="base_radio_group">
                  <div class="base_radio">
                    <label for="elut_a" id="editUserType"></label>
                  </div>
                  <div class="clear"></div>
                </div></td>
              <td style="width:180px;">&nbsp;</td>
            </tr>
            <tr>
              <td>帐&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</td>
                <td>
                        <span id="editUserName"></span>
                    </td>
              <td></td>
            </tr>

            <tr>
                <td>返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点:</td>
                <td>
                	<div class="base_text" id="editUserTip">
    					<input id="editReturnPoint" />
					</div>
				</td>
              <td><div class="form_tips"><span id="el_rebate_steping_tips">0.0%&nbsp;&nbsp;-&nbsp;&nbsp;15.0%</span></div></td>
            </tr>
            
           <tr>
                <td>不定位返点:</td>
                <td>
                	<div class="base_text" id="editUserTip">
    					<input id="editReturnNotPoint" />
					</div>
				</td>
              <td><div class="form_tips"><span id="el_rebate_steping_tips">0.0%&nbsp;&nbsp;-&nbsp;&nbsp;<?php echo $output['userinfo']['fanDianBdw']?>%</span></div></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><div class="base_button_group">
                  <div class="base_button">
                    <input type="button" id="el_cofirm" value="保存修改" />
                  </div>
                  <div class="base_button">
                    <input type="button" id="el_chanle" value="取消" />
                  </div>
                </div></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
<!--editor_lower end-->

<script type="text/javascript">
	var memberManage_NameOrNickName = "<?php echo $output['param']['nickname'] ?>";
	var memberManage_Type = "<?php echo $output['param']['type'] ?>"
    init_memberManage();
</script>
